/**
 * 
 */
package me.joshua.demo4j.spring.groovy.performance.script

import me.joshua.demo4j.spring.groovy.performance.model.Member
import me.joshua.demo4j.spring.groovy.performance.service.MemberService
import me.joshua.demo4j.spring.groovy.performance.service.ScriptService

import org.springframework.beans.factory.annotation.Autowired

/**
 * @author <a href="mailto:daonan.zhan@gmail.com">Joshua Zhan</a>
 */
class ScriptServiceGroovyImpl implements ScriptService {
	
	@Autowired
	MemberService memberService;

	@Override
	public void queryMember() {
	}

	@Override
	public Member queryMember(String name, String email) {
		Member member = memberService.findMember(email);
		if (name.equals(member.getName())) {
			return member;
		} else {
			return null;
		}
	}

	@Override
	public Member queryMemger(String name, String email, int id, int[] ids, String[] emails,
			String... names) {
		Member member = memberService.findMember(email);
		if (name.equals(member.getName())) {
			return member;
		} else {
			return null;
		}
	}
}
